<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>

<body>
    <script src="./MyPromise.js"></script>
    <script>
        const pro = new MyPromise((resolve, reject) => {
            setTimeout(() => {
                resolve(1)
            }, 3000);
        })

        pro.then(data => {
            console.log(1, data)
            return 123;
        }).then(data => {
            console.log(2, data)
            return new MyPromise(resolve => {
                resolve(456);
            });
        }).then(data => {
            console.log(3, data)
        })

        console.log(pro)
    </script>
</body>

</html>